package com.qcby.mybatis01.plugin;

/**
 * 自定义分页对象
 */
public class SelfPage {
    private int pageNo;
    private int pageSize;
    private int offset;

    public int getOffset() {
        this.offset = this.pageNo > 0 ? (this.pageNo - 1) * this.pageSize : 0;
        return offset;
    }
    public SelfPage(int pageNo, int pageSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    @Override
    public String toString() {
        return "SelfPage{" +
                "pageNo=" + pageNo +
                ", pageSize=" + pageSize +
                '}';
    }
}